Ext.define('HGMIDE.view.FullScreenButton', {
	extend : 'Ext.Button',
	xtype : 'fullscreenbutton',
	config : {
		cls : 'qpBtn',
		xtype : 'button',
		docked : 'right',
		listeners : {
			tap : function() {
				var id = this.getId()
						.substring(this.getId().indexOf('Btn') + 3);
				var emulator = Ext.getCmp('emulator' + id);
				var list = Ext.getCmp('ide_plugin_manage_space');
				var pluginSideBtn = Ext.getCmp('pluginSideBtn' + id);
				var emulatorObj = EmulatorManager.getEmulatorObj('emulator'
						+ id);
				var emulatorScreen = emulator.query('panel')[0];
				if (!emulatorObj.isFullScreen) {
					emulatorObj.isFullScreen = true;
					this.setCls('qpBtn2');
					emulatorScreen.setHeight(document.body.clientHeight);
					emulatorScreen.setWidth('100%');
					if (list.getHidden()) {
						pluginSideBtn.setCls('pluginSideBtn1_1');
					} else {
						pluginSideBtn.setCls('pluginSideBtn_1');
					}
					Util.btnTipText.setHtml(I18N.closeFullscreen);
				} else {
					emulatorObj.isFullScreen = false;
					this.setCls('qpBtn');
					var screen = EmulatorManager.currentEmulator.query('panel')[0];
					if (emulatorObj.isRotated) {
						screen.setHeight(emulatorObj.width);
						screen.setWidth(emulatorObj.height);
					} else {
						screen.setHeight(emulatorObj.height);
						screen.setWidth(emulatorObj.width);
					}
					if (list.getHidden()) {
						pluginSideBtn.setCls('pluginSideBtn1');
					} else {
						pluginSideBtn.setCls('pluginSideBtn');
					}
					Util.btnTipText.setHtml(I18N.openFullscreen);
				}
			}
		}
	}
});
